{extend name="layout:default" /}
{block name="title"}菜单列表{/block}
{block name="content"}
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">菜单信息</h3>
                <div class="box-tools">
                    <a href="{:url('add')}" class="btn btn-primary"> 添加 </a>
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
                <table class="table table-hover">
                    <tbody>
                    <tr>
                        <th>ID</th>
                        <th>菜单名称</th>
                        <th>url地址</th>
                        <th>菜单状态</th>
                        <th>创建时间</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                    {volist name="parents" id="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td style="font-weight:bold;">{$vo.name}</td>
                        <td>{$vo.url}</td>
                        <td>
                            {switch name="$vo.status" }
                            {case value="0"}<i style="color: red;">隐藏</i>{/case}
                            {case value="1"}<i style="color: green;">显示</i>{/case}
                            {/switch}
                        </td>
                        <td>{:date('Y-m-d H:i:s',$vo.create_at)}</td>
                        <td>{:date('Y-m-d H:i:s',$vo.update_at)}</td>
                        <td>
                            <a title="修改" href="{:url('edit',['id'=>$vo.id])}" class="btn btn-success"><i
                                    class="glyphicon glyphicon-edit"></i></a>
                            <a title="删除" href="{:url('del',['id'=>$vo.id])}" class="btn btn-danger"><i
                                    class="glyphicon glyphicon-trash"></i></a>
                        </td>
                    </tr>
                    {volist name="navs" id="v"}
                    {if condition="$v.pid eq $vo.id"}
                    <tr>
                        <td>{$v.id}</td>
                        <td>{$v.name}</td>
                        <td>{$v.url}</td>
                        <td>
                            {switch name="$v.status" }
                            {case value="0"}<i style="color: red;">隐藏</i>{/case}
                            {case value="1"}<i style="color: green;">显示</i>{/case}
                            {/switch}
                        </td>
                        <td>{:date('Y-m-d H:i:s',$v.create_at)}</td>
                        <td>{:date('Y-m-d H:i:s',$v.update_at)}</td>
                        <td>
                            <a title="修改" href="{:url('edit',['id'=>$v.id])}" class="btn btn-success"><i
                                    class="glyphicon glyphicon-edit"></i></a>
                            <a title="删除" href="{:url('del',['id'=>$v.id])}" class="btn btn-danger"><i
                                    class="glyphicon glyphicon-trash"></i></a>
                        </td>
                    </tr>
                    {/if}
                    {/volist}
                    {/volist}
                    </tbody>
                </table>
            </div>
            <!-- /.box-body -->
        </div>
        <!-- /.box -->
    </div>
</div>
{/block}